import torch

torch.random.manual_seed(10)
data = torch.randint(0, 10, [3, 4, 5, 6])
print(data)
print(data.shape)
# print(data.reshape(2, 3,-1).size())
# print(data.unsqueeze(dim=-1).unsqueeze(dim=1).squeeze().shape)
# print(torch.transpose(torch.transpose(data, 0, 1),1,2).shape)

# data1 = torch.transpose(data, 0, 1)
# print(data1.shape)
# data2 =torch.transpose(data1,1,2)
# print(data2.shape)
# data3 =torch.transpose(data2,2,3)
# print(data3.shape)

# print(torch.permute(data, [1, 2, 3, 0]).shape)
# print(data.permute([1, 2, 3, 0]).shape)

# 容错处理
# if data1.is_contiguous():
#     data1.view(2, 4, -1)
# else:
#     data1.contiguous().view(2, 4, -1)


# print(data1.contiguous().view(-1).shape)
